package com.kaiyidiannao.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.kaiyidiannao.main.R;
import com.kaiyidiannao.model.bean.JoinConstact;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by mark on 2014/4/16.
 * 我的竞价
 */
public class JoinConstactAdapter extends ImageLoaderBaseAdapter {

    private LayoutInflater layoutInflater;
    private List<JoinConstact> list = new ArrayList<JoinConstact>();
    private String[] imgs;
    private Context context;

    public JoinConstactAdapter(Context context, List<JoinConstact> list) {
        this.list = list;
        this.layoutInflater = LayoutInflater.from(context);
        this.context = context;
    }

    @Override
    public int getCount() {
        return list == null ? 0 : list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        TextView name = null;
        TextView mobile = null;
        JoinConstact joinConstact = list.get(position);
        if (convertView==null)
        {
            convertView=layoutInflater.inflate(R.layout.lv_item_joinconstact,null);
        }
        name = (TextView)convertView.findViewById(R.id.join_name);
        mobile = (TextView)convertView.findViewById(R.id.join_mobile);

        name.setText(joinConstact.getTruename());
        mobile.setText(joinConstact.getMobile());

        return convertView;
    }
}
